import React, {PureComponent} from 'react';
import './style.css'
import PartOne from "./pages/PartOne";
import PartTwo from "./pages/PartTwo";
import {connect} from 'react-redux';

class App extends PureComponent {

    render() {
        const {counter} = this.props;
        return (
            <>
                <h1>
                    React Redux Toolkit <span style={{color: 'red'}}>【{counter}】</span>
                </h1>
                <div className='container'>
                    <PartOne/>
                    <PartTwo/>
                </div>
            </>
        );
    }
}

App.propTypes = {};

const mapStateToProps = state => ({
    counter: state.counter.counter
})

export default connect(mapStateToProps)(App);